package com.itheima.health.dao;

import com.itheima.health.dto.SmsLoginParam;
import com.itheima.health.dto.VeiflcationcodeParam;
import com.itheima.health.pojo.User;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface SendDao {
/*
* 查询数据库
* */
    VeiflcationcodeParam selectlongin(SmsLoginParam smsLoginParam);
/*
* 添加数据库
* */
    void addcode(VeiflcationcodeParam veiflcationcodeParam);
/*
* 根据时间查询
* */
    @Select("select * from t_veriflcationcode where addTime<=#{time} and validateCode is not null")
    List<VeiflcationcodeParam> selectTime(LocalDateTime time);
    /*
    * 删除五分钟值前的
    * */
//    @Delete("delete from t_veriflcationcode where addTime<=#{time}")
    @Update("update t_veriflcationcode set validateCode=null where addTime<=#{time}")
    void delectVifica(LocalDateTime time);
/*
* 查询此数据库看看已经登录过
* */
    VeiflcationcodeParam seletDoes(VeiflcationcodeParam veiflcationcodeParam);
/*
* 如果存在 就修改此条数据
* */
    void savecode(VeiflcationcodeParam veiflcationcodeParam);
}
